home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / misc / DReg.lha / DReg / DReg_Manual < prev    next >
Text File  |  1994-12-15  |  8KB  |  174 lines

  1.  
  2.  
  3.  
  4.  
  5.     DReg v1.2 is Copyright © 94 of  Paul Juhasz
  6.                                     28 Ellora Rd
  7.                                     Streatham
  8.                                     London SW16 6JF
  9.  
  10.  
  11.  
  12.     This program is Freeware. Permission is hereby given to any individual
  13.     to copy and distribute DReg as long as no fee is charged for it apart
  14.     from the cost of media and expenses. No responsibility is accepted for
  15.     any damage to your data through use or misuse of DReg.
  16.  
  17.  
  18.                         *     *    *   *   *    *     *
  19.  
  20.  
  21.     Preamble:
  22.     --------
  23.  
  24.     DReg v1.2 is a Data Register Processor, which means that it emulates
  25.     the 68000 to help in pre-debugging. It can also work as a training
  26.     aid for would-be assembler programmers. It works the way the Motorola
  27.     68000 does, so you can see what happens when you add one byte of two
  28.     registers together, multiply, divide or negate a word.
  29.  
  30.     DReg was not intended to be a calculator as such, though with a bit of
  31.     practice even that can be achieved. Where it helps is when you need to
  32.     see the results of complicated bit operations like EOR, ROXL and ASR
  33.     which one is never too sure about. Until a big red flashing requester
  34.     turns up. It is possible to do these operations in MonAm as well, but
  35.     using DReg is less complicated and much more fun, which is an essential
  36.     ingredient of good and clean programming.                         :-))
  37.  
  38.     For any non-programmers DReg can be the difference between either
  39.     understanding of how the 68000 works or chucking the book at the wall
  40.     and re-booting with Frontier (Aaarrrgghh! I chucked Frontier at the wall,
  41.     at least until the next time:)).  With a bit of experimenting you can
  42.     even get DReg to teach you how to program in fast assembler.
  43.  
  44.  
  45.  
  46.     How-To:
  47.     ------
  48.  
  49.     The gadgets should be straight forward, but I will explain them, just
  50.     to be awkward and give you lots to read. From the top left:
  51.  
  52.  
  53.     Titlebar                -   Apart from the usual Close/Drag/Depth gad-
  54.                                 gets there is an 'Iconize' gadget. Click on
  55.                                 this to put DReg to sleep. The DReg icon is
  56.                                 by default placed in the screen-titlebar,
  57.                                 but can be moved anywhere. Press menubutton
  58.                                 (RMB) when icon active to de-iconize DReg.
  59.  
  60.     Two lines of 32 '0's    -   the 'bits' of the two registers currently
  61.                                 in use. Enter values into these by clicking
  62.                                 on any of the 0's: they will change to 1's.
  63.                                 The top row represents the source and the
  64.                                 bottom row the destination register bits.
  65.  
  66.     Two register selectors  -   in the right half of the panel, between the
  67.                                 line of 32 bits and the hexadecimal/decimal
  68.                                 display. They cycle through the 4 registers.
  69.                                 All of these (D0-D3) will keep their values
  70.                                 until changed either by clicking on the
  71.                                 bits or by an operation.
  72.  
  73.     Two HEX/DEC displays    -   panel top far right, these represent the
  74.                                 eight 'nibbles' of a 32-bit long-word or
  75.                                 a signed decimal long, int or byte with
  76.                                 commas separating every thousand. These
  77.                                 can not be changed manually, they are only
  78.                                 there for display.
  79.  
  80.     Status Bits display     -   on the right will represent the result of
  81.                                 any operation. The X-bit value is also
  82.                                 used in extended operations - see below.
  83.  
  84.     Three Op-Size selectors -   in the bottom left of the panel shows the
  85.                                 currently selected instruction size. Only
  86.                                 one of them can be highlighted at any one
  87.                                 time. Does not affect the hex display,
  88.                                 only the decimal.
  89.  
  90.     Lots of Op-Code buttons -   these take up most of the lower half of
  91.                                 the panel. Their meaning should be self-
  92.                                 evident, but any book on A68k assembler
  93.                                 programming will explain them in detail.
  94.  
  95.     Instruction                                                  Op-Size
  96.     -----------                                                  -------
  97.  
  98.     CLR     -   Clears destination                              .b  .w  .l
  99.     NEG     -   Arithmetically negates destination              .b  .w  .l
  100.     NOT     -   Logically invert destination                    .b  .w  .l
  101.     AND     -   Logical and source -> destination               .b  .w  .l
  102.     OR      -       "   or    "    ->      "                    .b  .w  .l
  103.     EOR     -   Exclusive or source -> destination              .b  .w  .l
  104.     LSL     -   Logical shift left destination >>
  105.                     by source number of bits                    .b  .w  .l
  106.     ROL     -   Rotate destination left by source nr of bits    .b  .w  .l
  107.     ROXL    -     "         "       "   with extend             .b  .w  .l
  108.     LSR     -  \
  109.     ROR     -    same as last three but going right             .b  .w  .l
  110.     ROXR    -  /
  111.     ASL     -   Arithmetic shift left (as LSL)                  .b  .w  .l
  112.     MULU    -   Multiply unsigned source.W * dest.W -> dest.L    -  .w   -
  113.     MULS    -      "     signed   source.W * dest.W -> dest.L    -  .w   -
  114.     ASR     -   As ASL but going right                          .b  .w  .l
  115.     DIVU    -   Divide unsigned dest.L / source.W -> dest.W
  116.                     with remainder in upper word of destination  -  .w   -
  117.     DIVS    -   Same as DIVU but signed
  118.     ADD     -   Add source + dest -> dest                       .b  .w  .l
  119.     EXG     -   Exchange source <-> destination                  -   -  .l
  120.     MOVE    -   Move source -> destination                      .b  .w  .l
  121.     SUB     -   Subtract source from destination                .b  .w  .l
  122.     SWAP    -   Swap the two halves of destination               -  .w   -
  123.  
  124.  
  125.     Op-Codes are executed according to size specifier, so if you use CLR
  126.     with .B, the operation will only clear a byte.
  127.  
  128.     The ROXL, ROXR commands will re-use the X flag which was set by the
  129.     previous command. This should be upwardly compatible with faster
  130.     processors such as the A1200/A4000, as I have used the exec.lib
  131.     GetCC/SetSR as recommended by the RKM.
  132.  
  133.     The button marked HEX controls the display in the top right of the
  134.     panel, toggle it and it will display in DECimal.
  135.  
  136.     The ABOUT button is quite important too: it tells you about the legal
  137.     aspect of useage of DReg v1.2 - ©'94 and the name of the author of
  138.     this little gem.                                                 ;-)
  139.  
  140.  
  141.     Epilogue:
  142.     --------
  143.  
  144.     DReg was written in optimized assembler, helping to debug itself as it
  145.     grew. It is as fast as Intuition can handle its complex structures.
  146.  
  147.     In order to avoid the 'negative' look that WB2.xx will produce on some
  148.     1.3 icon grafix, DReg will select its colours according to the WorkBench
  149.     version it is running on. To make it easier to implement this colour-
  150.     change, being a lazy programmer myself, some gadgets use Border and
  151.     IntuiText structures, though most of them ( the 64 bits ) use Images.
  152.     The result is a trade-off of a little bit of speed for compactness and
  153.     colour flexibility.
  154.  
  155.     Any contact such as bug reports, suggestions, criticisms is welcome.
  156.     In case I get enough response for any updates, I could include some
  157.     additional commands, a colour cycling button and whatever else may
  158.     seem allright at the time... Memory access ?
  159.  
  160.  
  161.     Written:        24th June - 22nd July, 1993, Paul Juhasz
  162.  
  163.  
  164.     Updates of DReg:
  165.     ---------------
  166.  
  167.     V1.1    -   24-28 July  93  -   Iconize gadget added and program
  168.                                     further optimized.
  169.  
  170.     V1.2    -   22-23 March 94  -   Modified launch.i added to free up CLI.
  171.                                     See launch.i (ACC 22) for details.
  172.  
  173.  
  174.